﻿@{
    ViewBag.Title = "Manage Progress - Project Management System";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>
    Manage Progress</h2>
<form action="" method="post" id="form" name="formProgress">
<input type="hidden" id="Action" name="Action" />
<ul class="shortcut-buttons-set">
    <li><a class="shortcut-button" href="#" onclick="if(DoAction('@Url.Action("Upload", "Schedule")')==-1)jAlert('Please Select One Item', 'Message');"><span>
        <img src="../../Content/images/icons/page-up-icon.png" alt="icon" /><br />
        Statement</span></a></li>
  
</ul>
<!-- End .shortcut-buttons-set -->
<div class="clear">
</div>
<!-- End .clear -->
<!-- Search -->
<input type="hidden" id="isSearch" name="isSearch" value="@ViewData["IsSearch"]" />
<div class="content-box" id="Search">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3 id="toggleSearch">
            Search</h3>
        <div class="clear">
        </div>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        <fieldset>
            <div class="childCol">
            <p>
                <label class="width12 floatLeft">
                    Project:</label>
                @Html.DropDownList("ProjectID", (SelectList)ViewData["ProjectList"], new { @class = "width20 input-inline", onchange = "$('#Page').attr('value', 1);$('form').submit();" })
            </p>
            <p>
                <label class="width12 floatLeft">
                    Group:</label>
                @Html.DropDownList("GroupID", (SelectList)ViewData["GroupList"], new { @class = "width20 input-inline", onchange = "$('#Page').attr('value', 1);$('form').submit();" })
            </p>
            </div>
            <div class="childCol">
                <p>
                    <label class="width12 floatLeft">
                        Schedule:</label>
                    @Html.DropDownList("ScheduleID", (SelectList)ViewData["ScheduleList"], new { @class = "width20 input-inline", onchange = "$('#Page').attr('value', 1);$('form').submit();" })
                </p>
                  <p>
                    <label class="width12 floatLeft">
                        Semester:</label>
                    @Html.DropDownList("SemesterID", (SelectList)ViewData["SemesterList"], new { @class = "width20 input-inline", onchange = "$('#Page').attr('value', 1);$('form').submit();" })
                </p>
            </div>
        </fieldset>
    </div>
</div>
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Progress List</h3>
        <div class="clear">
        </div>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        <div>
            <!-- This is the target div. id must match the href of this div's tab -->
            @{ if (TempData["Message"] != null)
               {
                <div class="notification attention png_bg">
                    <a href="#" class="close">
                        <img src="../../Content/images/icons/cross_grey_small.png" title="Close this notification"
                            alt="close" /></a>
                    <div>
                        @TempData["Message"].ToString()
                    </div>
                </div>
               }
            }
            @{ 
                var pageSize = int.Parse(ViewData[PMS.ENT.PageInfo.PageSize.ToString()].ToString());
                var pageNum = int.Parse(ViewData[PMS.ENT.PageInfo.PageNum.ToString()].ToString());
                var page = int.Parse(ViewData[PMS.ENT.PageInfo.Page.ToString()].ToString()); }
            <input type="hidden" value="@ViewData["OrderBy"]" name="orderBy" id="orderBy" />
            <input type="hidden" value="@ViewData["OrderDirection"]" name="orderDirection"
                id="orderDirection" />
            @{if (Model.Count <= 0)
              {
                <div class="RecordFound @("RecordFound" + @Model.Count)">
                    No Record Found</div>
              }
            }
            <table class="flexigird TableGrid">
                <thead>
                    <tr>
                        <th id="Selected">
                            <input class="check-all" type="checkbox" id="checkAll" />
                        </th>
                        <th id="Project">
                            Project
                        </th>
                        <th id="Schudule">
                            Schudule
                        </th>
                        <th id="Group">
                            Group
                        </th>
                        <th id="Progress">
                            Progress
                        </th>
                        <th id="Mark">
                            Mark
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @{ for (int i = 0; i < Model.Count; i++)
                       {
                           string scheduleName = @Model[i].ScheduleName;
                           string projectName = @Model[i].ProjectName;
                           string groupname = @Model[i].GroupName;
                        <tr>
                            <td>
                                <input type="checkbox" id="ProgressID" name="ProgressID" value="@Model[i].ProgressID"
                                        group="Selected" onclick="Uncheck('ProgressID');"  />
                            </td>
                            <td>
                               @Html.ActionLink(projectName, "ViewProject","Project", new { ID = Model[i].ProjectID }, null)
                            </td>
                            <td>
                               @Html.ActionLink(scheduleName, "ViewSchedule","Schedule", new { ID = Model[i].ScheduleID }, null)
                            </td>
                            <td>
                                @Html.ActionLink(groupname, "ViewGroup","Project", new { ID = Model[i].GroupID }, null)
                            </td>
                            <td>
                                @(PMS.Utilities.Utility.StringParse(Model[i].Progress) + " %")
                            </td>
                            <td>
                                @(PMS.Utilities.Utility.StringParse(Model[i].Mark))
                            </td>
                        </tr>
                       } 
                    }
                </tbody>
            </table>
            @{Html.RenderPartial("Pagination", null, ViewData); }
        </div>
        <!-- End #tab1 -->
    </div>
    <!-- End .content-box-content -->
</div>
<!-- End .content-box -->
</form>
<script language="javascript" type="text/javascript">
    $("#Schedule").addClass("current");
    $("#Progress").addClass("current");

    $("#toggleSearch").click(function () {
        if ($("#isSearch").val() == 1) {
            $("#isSearch").val(0);
        }
        else {
            $("#isSearch").val(1);
        }
    });
     var isSearch = @ViewData["IsSearch"];
    if (isSearch == '1') {
        $("#Search").removeClass('closed-box');
    }
    else {
        $("#Search").addClass('closed-box');
    }
     
</script>
